﻿using System;

namespace ChangeText
{
    /// <summary>
    /// Program attributes
    /// </summary>
    public class Attributes
    {
        /// <summary>
        /// Gets path to file
        /// </summary>
        public string FileOrListPath { get; private set; }

        /// <summary>
        /// Gets replacing text
        /// </summary>
        public string TextToFind{ get; private set; }

        /// <summary>
        /// Gets text to replace with
        /// </summary>
        public string TextToReplace{ get; private set; }

        /// <summary>
        /// Gets text to replace with
        /// </summary>
        public string Encoding { get; private set; }

        /// <summary>
        /// Initialize a new instance of <see cref="Attributes" /> class
        /// </summary>
        /// <param name="fileOrListPath">The file or list path.</param>
        /// <param name="textToFind">The text to find.</param>
        /// <param name="textToReplace">The text to replace.</param>
        /// <param name="encoding">The encoding.</param>
        /// <exception cref="System.ArgumentNullException">
        /// fileOrListPath
        /// or
        /// textToFind
        /// </exception>
        public Attributes(string fileOrListPath, string textToFind, string textToReplace,string encoding)
        {
            if (string.IsNullOrEmpty(textToReplace)) textToReplace=string.Empty;
            if (string.IsNullOrEmpty(encoding)) encoding = string.Empty;

            FileOrListPath = fileOrListPath;
            TextToFind = textToFind;
            TextToReplace = textToReplace;
            Encoding = encoding;

        }

        
    }
}